<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.Timestamp"%>
<%@page import="java.util.LinkedList"%>
<%@page import="java.util.ArrayList"%>
<%@page import="nl.ruudshuis.beans.VeilingBean"%>
<%@page import="nl.ruudshuis.beans.BiedingBean"%>
<%@page import="nl.ruudshuis.beans.GebruikerBean"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

	<!-- stylesheets -->
<link rel=stylesheet href="style.css" type="text/css" media="screen">
<link rel="stylesheet"	href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
	<!-- Einde stylesheets -->
	
	<!-- Javascripts -->
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script
	src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"
	type="text/javascript"></script>
<script
	src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"
	type="text/javascript"></script>
<script
	src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js"
	type="text/javascript"></script>
<script
	src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/i18n/jquery-ui-i18n.min.js"
	type="text/javascript"></script>
	
<script src="registreren.js" type="text/javascript"></script>

<script type="text/javascript">
            $(document).ready(function(){
                $contentLoadTriggered = false;
                $("#contentwrapper").load("VeilingController?item=refresh&page=home");
                $("#content").scroll(function(){
                    if($("#content").scrollTop() + 400 >= ($("#content").height()) && $contentLoadTriggered == false)
                    {
                        $contentLoadTriggered = true;
                        $("#contentwrapper").load("VeilingController?item=meer"); 
                        $contentLoadTriggered = false;
                    }
                });
                var refreshId = setInterval(function() {
              		$("#contentwrapper").load("VeilingController?item=refresh&page=home");
              		$("#contentwrappermv").load("VeilingController?item=refresh&page=mijnveiling");
              		$("#contentwrappermb").load("VeilingController?item=refresh&page=mijnbieding");
           			}, 1000);
                $.ajaxSetup({ cache: false });
            });
</script>

<!-- einde van de javascripts -->


<title>Ruuds VeilingsHuis</title>
</head>
<body>
	<div id="dialog-form" title="Registreren">
	<p class="validateTips">Alle velden zijn verplicht.</p>
		<form id="register" method="POST" action="RegistreerController">
			<fieldset>
				<label for="email">Email</label> 
				<input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" />
				
				<label for="password">Wachtwoord</label>
				<input type="password" name="password" id="password" value="" class="text ui-widget-content ui-corner-all" />
				
				<label for="woonplaats">Woonplaats</label>
				<input type="text" name="woonplaats" id="woonplaats" value="" class="text ui-widget-content ui-corner-all" />
				
				<label for="telnr">Telefoon nr</label>
				<input type="text" name="telnr" id="telnr" value="" class="text ui-widget-content ui-corner-all" />
			</fieldset>
		</form>
	</div>
	<div id="wrapper">
		<div id="header">

			<img
				src="http://a1.twimg.com/profile_images/1348635582/huis_en_tuin.png"
				alt="Ruuds Veilinghuis" />
			<h1>Ruuds Veilinghuis</h1>
			<%if(session.getAttribute("loggedIn") == null){
				out.println("<div id='login'>");
				out.println("<form method='POST' action='LoginController'>");
				out.println("<input type='text' name='login' value='email' /> <input type='password' name='pass' value='wachtwoord' /> <input type='submit' value='Inloggen' name='submit' />");
				out.println("</form>");
				out.println("<a href='#' id='create-user'>Nog geen account?</a>");
				out.println("</div>");
			}
			else{
				out.println("<div id='login'>");
				GebruikerBean gb = (GebruikerBean) session.getAttribute("loggedIn");
				out.println("U bent ingelogd als: " + gb.getEmail());
				
				out.println("<form method='GET' action='LoginController'>");
				out.println("<input type='submit' value='Uitloggen' name='submit' />");
				out.println("</form>");
				out.println("</div>");
			}
				%>
			
			
		</div>
		<div id="subhead">
			<div id="menu">
				<ul>
					<li><a href="VeilingController">Laatste Veilingen</a></li>
					<li><a href="VeilingController?item=mijnveiling">Mijn Veilingen</a></li>
					<li><a href="VeilingController?item=mijnbieding">Mijn Biedingen</a></li>
					<li><a href="VeilingController?item=toevoegen">Veiling
							Toevoegen</a></li>
				</ul>
			</div>
			<div id="zoeken">
				<form action="VeilingController?item=zoeken" method="GET">
					<input type="hidden" name="item" value="zoeken" />
					<input type="text" name="zoekopdracht" /> 
					<input type="submit" name="zoeken" value="Zoek!" />
				</form>
			</div>
		</div>